<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>定位问题</title>
  <style type="text/css">
    body{
      margin: 20px;
    }
    .relative{
      position: relative;
      width: 400px;
      height: 200px;
      border: 1px solid #ccc;

      top: 20px;
      left: 50px;
    }
    .absolute{
      position: absolute;
      width: 200px;
      height: 100px;
      border: 1px solid burlywood;

      top: 20px;
      left: 50px;
    }
  </style>
</head>
<body>
  <div class="relative">
    <div class="absolute">
      this is abslute
    </div>
  </div>
  <h3>absolute 和 relative 定位问题</h3>
  <ul>
    <li>relative 依据自身定位</li>
    <li>absolute 依据最近一层的定位元素定位</li>
  </ul>
  <h3>定位元素</h3>
  <ul>
    <li>absolute relative fixed</li>
    <li>body</li>
  </ul>
</body>
</html>